Repository navigation
fix(upload): fail a block with 404 instead of silently dropping it - #285
Merged
Merged
Conversation
Closes #279 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📝 Summary
When a block arrived for an upload that no longer existed, the server silently skipped it and still answered
201. The client kept going, and the missing part only surfaced later as a failed finalize or a broken restore, with nothing in the logs. The row can disappear mid-upload:cleanup:uploadsreaps uploads idle for over a minute, andcompleteUpload/abandonUploaddelete it too.Now the block request fails with
404on the block that caused it.A part written after its row was deleted mid-stream becomes Orphaned Storage and is reclaimed by the existing sweep (ADR-0001).
✅ Verification
New
tests/upload-part.test.ts:Before (
origin/dev):After: 3/3 pass on sqlite+filesystem, postgres+s3, mysql+s3.
pnpm test:run(sqlite+filesystem): 21 files passed, 2 skippedpnpm type-check,pnpm lint,pnpm build: pass🔍 Reviews
Unfixed: "unread body on 404" is handled by Node draining the request. Spec notes accepted as is: the mid-stream case is tested at the storage seam (the route maps
falseto 404), two tests instead of one, and orphaned bytes until the grace-period sweep, which ADR-0001 covers.🔗 Issues
Closes #279
💥 Merge danger
Door: two-way
Blast Radius: uploads
Clients that previously got a silent
201for a dropped block now get a404and fail the save early. That is the intended behavior.🤖 Generated with Claude Code